package cn.wizzer.app.onlyoffice.modules.services.impl;

import cn.wizzer.app.onlyoffice.modules.config.OnlyOfficeProperties;
import cn.wizzer.app.onlyoffice.modules.models.documentServer.DefaultCustomizationWrapper;
import cn.wizzer.app.onlyoffice.modules.models.documentServer.EditorConfig;
import cn.wizzer.app.onlyoffice.modules.services.CustomizationConfigurer;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;

@IocBean
public class CustomizationConfigurerImpl implements CustomizationConfigurer<DefaultCustomizationWrapper> {
    @Inject
    private OnlyOfficeProperties onlyOfficeProperties;

    @Override
    public void configure(EditorConfig.Customization customization, DefaultCustomizationWrapper wrapper) {
        customization.setSubmitForm(false);
        customization.setLogo(onlyOfficeProperties.getLogo());
        customization.setCustomer(onlyOfficeProperties.getCustomer());
        customization.setGoback(onlyOfficeProperties.getGoBack());
    }
}
